package com.anli.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.Map;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2021/3/8  14:34
 * 描述:
 */
@Mapper
@Repository
public interface StockDao {

    //查询库存
    @Select("select stock from base_stock where goods_id=#{goodsId}")
    int getStock(String goodsId);


    @Update("update base_stock set stock=#{stock} where goods_id=#{goodsId}")
    int updateStock(Map<String,Object> map);

}
